#ifndef _PLANE_H
#define _PLANE_H

#include "vector.h"
#include "sphere.h"

/**************************************
 * Definition of the plane primitive
 **************************************/
struct EE_EXPORT Planef
{
	Vector3f	normal; 
	float		distance; 

	Planef(void)
	:
	normal(0.0F, 0.0F, 0.0F),
	distance(0.0F)
	{ }

	Planef(Vector3f& a, Vector3f& b, Vector3f& c); 
	Planef(Vector3f& n, float d); 
	Planef(Vector3f * pV); 
	Planef(float nx, float ny, float nz, float d); 

	void	normalize(void); 

	enum Classification
	{
		ABOVE = 1,
		BELOW = -1,
		INTERSECTING = 0
	};

	static Classification ClassifyPoint(Planef* pPlane, Vector3f* pPoint);
	static Classification ClassifySphere(Planef* pPlane, Vector3f* pCenter, const float radius);
	static Classification ClassifySphere(Planef* pPlane, Spheref* pSphere);
	static float Distance(Planef* pPlane, Vector3f* pPoint);
}; 

#endif